package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	fmt.Fprintf(os.Stdout, "\n")
	allProjectsPath := GetAllProjectsPath()
	usageTemplate := "---> Will Set the environment variable: \n" + allProjectsPath + "\n\n"
	usageTemplate = usageTemplate + ">>> Please Select: \n"
	usageTemplate = usageTemplate + ">>> 1.Set the environment variable. \n"
	usageTemplate = usageTemplate + ">>> 2.Exit. \n"
	usageTemplate = usageTemplate + ">>> Your Select: "
	fmt.Fprintf(os.Stdout, usageTemplate)

	reader := bufio.NewReader(os.Stdin)
	for {
		data, _, _ := reader.ReadLine()
		command := string(data)
		if command == "1" {
			SetAllProjectsPath(allProjectsPath)
			break
		}
		if command == "2" {
			break
		}
	}

	fmt.Println("")
	fmt.Fprintf(os.Stdout, "Successful operation, Press the Enter key to exit...")
	reader = bufio.NewReader(os.Stdin)
	for {
		data, _, _ := reader.ReadLine() 
		if data != nil {
			break
		}
	}
}
